You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Statistics Class > Statistics Methods > Percentile Method > Statistics.Percentile Method ([In] TVec, double, TPercentileMethod)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Statistics.Percentile Method ([In] TVec, double, TPercentileMethod)

Percentile.

Syntax
C#
Visual Basic
public static double Percentile([In] TVec X, double P, TPercentileMethod Method);
Parameters 
Description 
[In] TVec X 
Data. An exception is raised if X is complex. 
double P 
Defines the 100*p percentile. The parameter P must lie in the interval (0,1), otherwise an exception is raised. 
TPercentileMethod Method 
Defines one of the available methods for calculating percentile. Software packages use different methods to calculate percentiles. For example, Excel uses pctMethodNMinus, while on the other hand, NCSS's default method is pctMethodNPlus. 

the 100*P th percentile of all X vector elements. The 100*P -th percentile is defined as the value that is greater than 100*P percent of the values in X.

Calculate the 2nd quantile location = median position.

using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector a = new Vector(0); double pctile; a.SetIt(false, new double[] {1,2,3,10,15,21}); pctile = Statistics.Percentile(a,0.75,TPercentileMethod.pctMethodNPlus); // = 16.5 pctile = Statistics.Percentile(a,0.75, TPercentileMethod.pctMethodNMinus); // = 13.75 pctile = Statistics.Percentile(a,0.75,TPercentileMethod.pctMethodClosestN); // = 10 } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!